# import cv2
# import numpy as np
#
# # 读取图像
# image = cv2.imread('tk.jpeg', cv2.IMREAD_GRAYSCALE)
# if image is None:
#     print("Error: Unable to load image.")
#     exit()
#
# # 线性变换参数
# a = 1.5  # 斜率
# b = 50   # 截距
#
# # 线性变换
# linear_transformed = cv2.convertScaleAbs(image, alpha=a, beta=b)
#
# # 显示原始图像和线性变换后的图像
# cv2.imshow('Original Image', image)
# cv2.imshow('Linear Transformed Image', linear_transformed)
# cv2.waitKey(0)
# cv2.destroyAllWindows()